
<link rel="stylesheet" href="__PUBLIC__/yksui/css/zui.css" rel="stylesheet"/>
<style>
    .w120{width: 80px;}
</style>
<div class="container" style="margin-top: 20px;">
    <form  id="carrierForm" method="post" action="{:U('Carrier/doAddCarrier')}">
    <!--<form  id="carrierForm" method="post" action="">-->
        <table class="table table-bordered" >
            <tr>
                <th>承运商名称：</th>
                <td><input type="text" name="name" /><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th class="Wdate">提货时间：</th>
                <td><input type="text" name="pickingtime" value="{$vo.pickingtime}" id="pickingtime"/><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th>提货地点：</th>
                <td><input type="text" name="pickingaddress" value="{$vo.pickingaddress}" /><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th>结款方式：</th>
                <td><input type="text" name="paymethod" value="{$vo.paymethod}" /><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th>计费方式：</th>
                <td><input type="text" name="billingway" value="{$vo.billingway}" /><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th>承运商状态：</th>
                <td>
                    <span >开启<input  type="radio" name="is_used" value="1" checked /></span>
                    <span>关闭<input  type="radio" name="is_used" value="0"/></span>
                </td>
            </tr>
        </table>

        <table class="table table-bordered" id="addtable">
            <thead>
            <tr>
            <th>服务名称</th>
            <th class="Wdate">时效（天）</th>
            <th>是否启用</th>

            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <input type="text" class="form-control w120" name="service_name[]" value="" placeholder="">
                </td>
                <td>
                    <input type="text" class="form-control w120" name="aging[]" value="" placeholder="">
                </td>
                <td>
                    <input name="service_is_used0" value="1" type="radio"  checked>
                    启用<br/>
                    <input name="service_is_use0" value="0" type="radio">
                    关闭
                </td>
            </tr>
            </tbody>
        </table>
        <a id="xinzen" href="javascript:void(0)" onclick="addConsignerAddress()" title=""> 新增一行 </a>
<div class="clearfix"></div>
<div class="text-center">
        <button id="sub" class="btn btn-primary jsSearchBtn " type="submit" >确定</button></div>
    </form>
</div>

<script type="text/javascript" src="__PUBLIC__/javascripts/admin/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/javascripts/admin/WdatePicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/javascripts/admin/layer/layer.js"></script>
<script type="application/javascript">
    function addConsignerAddress() {
        var num = document.getElementById("addtable").rows.length;
        var Tr = document.getElementById("addtable").insertRow(num);
        Td = Tr.insertCell(Tr.cells.length);
        Td.innerHTML='<input name="service_name[]" type="text" class="form-control w120">';
        Td = Tr.insertCell(Tr.cells.length);
        Td.innerHTML='<input name="aging[]" type="text" class="form-control w120">';
        Td = Tr.insertCell(Tr.cells.length);
        Td.innerHTML='<input name="service_is_used'+num+'" value="1" type="radio" checked>启用<br/><input name="service_is_used'+num+'" value="0" type="radio">关闭';

    }
    $(function () {
//        $("#sub").on('click', function () {
//            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
//            layer.load();
//            $.ajax({
//
//                url: "{:U('Carrier/doAddCarrier')}",
////                url: "__URL__/doAddCarrier",
//                type: 'post',
//                async: false, //default: true
//                data: $('#carrierForm').serialize(),
//                dataType: 'json', // default: Intelligent Guess (xml, json, script, or html)
//
//                success: function (data, textStatus, jqXHR) {
//                    if(data=='添加成功'){
//                        parent.location.reload();
//                        parent.layer.close(index); //执行关闭
//                    }
//                    layer.closeAll('loading');
//                    layer.msg(data);
//                    //parent.layer.close(index)
//                }
//            })
//
//
////
////                success: function (data) {
////                    if (data == '添加成功') {
////                        parent.location.reload();
////                    }else{
////                        return ;
////                    }
////                }
////            })
//        })
        /**
         * 日期时间选择
         */
        $('#pickingtime').click(function () {
            WdatePicker({skin: 'twoer', dateFmt: 'HH:mm:00'})
        })


    })
</script>


